﻿@model MRSSApp.ViewModel.CreateAppointmentViewModel

@{
    ViewBag.Title = "Create";
}

<h2>Create</h2>
<h4>Appointment!!</h4>
<hr />
@if(!string.IsNullOrEmpty(Model.ErrorMessage))
{
    <div class="alert alert-danger" role="alert">
        <p>@Model.ErrorMessage</p>
    </div>
}
@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()

    <div class="form-horizontal">

        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        <div class="form-group">
            @Html.LabelFor(model => model.DepartmentId, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.DropDownListFor(model => model.DepartmentId, Model.DepartmentList, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.DepartmentId, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.DoctorName, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.DropDownListFor(model => model.DoctorName, Model.DoctorList, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.DoctorName, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.AppointmentDateTime, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.AppointmentDateTime, new { htmlAttributes = new { @class = "form-control", @placeholder = "Appointment Time" } })
                @Html.ValidationMessageFor(model => model.AppointmentDateTime, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.PersonFirstName, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.PersonFirstName, new { htmlAttributes = new { @class = "form-control", @placeholder = "Name" } })
                @Html.ValidationMessageFor(model => model.PersonFirstName, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.PersonLastName, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.PersonLastName, new { htmlAttributes = new { @class = "form-control", @placeholder = "Last Name" } })
                @Html.ValidationMessageFor(model => model.PersonLastName, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.PersonAge, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.PersonAge, new { htmlAttributes = new { @class = "form-control", @placeholder = "Age" } })
                @Html.ValidationMessageFor(model => model.PersonAge, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Gender, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.DropDownListFor(model => model.Gender, Model.GenderList, new { @class = "form-control" } )
                @Html.ValidationMessageFor(model => model.Gender, "", new { @class = "text-danger" }) 
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.ContactNumber, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.ContactNumber, new { htmlAttributes = new { @class = "form-control", @placeholder = "###-###-####" } })
                @Html.ValidationMessageFor(model => model.ContactNumber, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.AlternateNumber, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.AlternateNumber, new { htmlAttributes = new { @class = "form-control", @placeholder = "###-###-####" } })
                @Html.ValidationMessageFor(model => model.AlternateNumber, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.EmailAddress, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.EmailAddress, new { htmlAttributes = new { @class = "form-control", @placeholder = "abc@gmail.com" } })
                @Html.ValidationMessageFor(model => model.EmailAddress, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.InternalProblem, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextAreaFor(model => model.InternalProblem, new { @class = "form-control", @style = "width:100%;" })
                @Html.ValidationMessageFor(model => model.InternalProblem, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="Create" class="btn btn-default" />
            </div>
        </div>
    </div>
}

@section scripts
{
    <script type="text/javascript">
        $(function () {
            $("#AppointmentDateTime").datetimepicker({

            });
        })
    </script>
}
